home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Resources / Chat & Communication / Digsby build 37 / digsby_setup.exe / lib / yahoo / yahooP2Pprotocol.pyo (.txt) < prev    next >
Python Compiled Bytecode  |  2008-10-13  |  3KB  |  55 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.5)
  3.  
  4. from yahoo.yahoolookup import services
  5. from yahoo.yahoolookup import statuses
  6. from yahoo.yahooutil import to_ydict
  7. from yahoo.yahooP2Psocket import YahooP2PSocket
  8.  
  9. class YahooP2P(object):
  10.     
  11.     def __init__(self, yahoo, buddy, me, remote_client, session_id):
  12.         self.yahoo = yahoo
  13.         self.buddy = buddy
  14.         self.me = me
  15.         self.rc = remote_client
  16.         self.socket = YahooP2PSocket(self, self.rc, session_id)
  17.         self.socket.connect(self.rc)
  18.  
  19.     
  20.     def incoming_message_raw(self, ydict_iter):
  21.         self.yahoo.incoming_message_raw(ydict_iter)
  22.  
  23.     message_notinoffice_raw = message_offline_raw = message_brb_raw = incoming_message_raw
  24.     
  25.     def notify_typing(self, typing_status, flag):
  26.         self.yahoo.notify_brb(self.buddy, typing_status, flag)
  27.  
  28.     
  29.     def on_close(self):
  30.         foo = self.yahoo.peertopeers.pop(self.buddy)
  31.  
  32.     
  33.     def on_connect(self):
  34.         self.send('p2pfilexfer', 'available', buddy = self.me, to = self.buddy, flag = '1', typing_status = 'PEERTOPEER', **{
  35.             '2': '1' })
  36.  
  37.     
  38.     def p2pfilexfer_available(self, buddy, to, flag, typing_status, **k):
  39.         if flag == '5':
  40.             self.send('p2pfilexfer', 'available', buddy = to, to = buddy, flag = '6', typing_status = 'PEERTOPEER')
  41.         elif flag == '7':
  42.             self.send('p2pfilexfer', 'available', buddy = to, to = buddy, flag = '7', typing_status = 'PEERTOPEER')
  43.         
  44.  
  45.     
  46.     def send(self, service, status, ydict = { }, **kw):
  47.         self.socket.ysend(services[service], statuses[status], data = to_ydict(ydict))
  48.  
  49.     
  50.     def Disconnect(self):
  51.         self.socket.close()
  52.         foo = self.yahoo.peertopeers.pop(self.buddy)
  53.  
  54.  
  55.